let app = document.getElementById("app")
//获得父级节点
let parentNode = app.parentNode
//获得当前元素的所有直接子节点
let nodeList = app.childNodes
for (let i = 0; i < nodeList.length; i++) {
    let node = nodeList[i]
    console.log("name:" + node.nodeName, "type:" + node.nodeType, "value:" + node.nodeValue)
}
//第一个子节点
let firstChild = app.firstChild
console.log("name:" + firstChild.nodeName, "type:" + firstChild.nodeType, "value:" + firstChild.nodeValue)
let lastChild = app.lastChild
console.log("name:" + lastChild.nodeName, "type:" + lastChild.nodeType, "value:" + lastChild.nodeValue)
//前一个节点
let h1 = lastChild.previousSibling
console.group('------------------')
console.log(h1)
console.group('------------------')
let img
for (let i = 0; i < nodeList.length; i++) {
    if (nodeList[i].nodeType === 1 && nodeList[i].nodeName === 'P') {
        let p = nodeList[i]
        //后一个节点
        img = p.nextSibling.nextSibling
        break;
    }
}
console.log(img)
img.src = "../img/expo.png"

//获得app的所有元素节点
console.group('------------app的所有元素节点------------')
let elementNode = app.children
for (let i = 0; i < elementNode.length; i++) {
    console.log(elementNode[i])
}